<!DOCTYPE html>
<html lang="zh-CN" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Emohaa AI Free 服务 | Free API</title>
    <meta name="description" content="支持高速流式输出、联网搜索、长文档解读、图像解析、多轮对话，零配置部署，多路token支持，自动清理会话痕迹">
    <link rel="preload stylesheet" href="/free-api/assets/style.df1f9c12.css" as="style">
    <script type="module" src="/free-api/assets/app.0efa0b2d.js"></script>
    <link rel="preload" href="/free-api/assets/inter-roman-latin.2ed14f66.woff2" as="font" type="font/woff2" crossorigin="">
  <link rel="modulepreload" href="/free-api/assets/chunks/framework.0ff2fc97.js">
  <link rel="modulepreload" href="/free-api/assets/chunks/theme.02f6d615.js">
  <link rel="modulepreload" href="/free-api/assets/freeapi_emohaa_index.md.3aeabad8.lean.js">
  <meta name="theme-color" content="#3eaf7c">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="msapplication-TileColor" content="#000000">
  <meta name="msapplication-TileImage" content="/free-api/favicon.ico">
  <meta name="baidu-site-verification" content="codeva-Whjnr38WFE">
  <link rel="icon" href="/free-api/favicon.ico">
  <link rel="apple-touch-icon" href="/free-api/favicon.ico">
  <link rel="mask-icon" href="/free-api/favicon.ico" color="#3eaf7c">
  <script src="https://hm.baidu.com/hm.js?8092fab2f2adfc7938ba5b8885aef5b4"></script>
  <script id="check-dark-light">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-1a20c99c><!--[--><!--]--><!--[--><span tabindex="-1" data-v-cc496148></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-cc496148> Skip to content </a><!--]--><!----><header class="VPNav" data-v-1a20c99c data-v-2e0f7f79><div class="VPNavBar has-sidebar" data-v-2e0f7f79 data-v-915b5228><div class="container" data-v-915b5228><div class="title" data-v-915b5228><div class="VPNavBarTitle has-sidebar" data-v-915b5228 data-v-25c72ff2><a class="title" href="/free-api/" data-v-25c72ff2><!--[--><!--]--><!--[--><img class="VPImage logo" src="/free-api/logo.png" alt data-v-66243ed0><!--]--><!--[-->Free API<!--]--><!--[--><!--[--><!--[--><!--[--><img class="visitor" src="https://visitor-badge.laobi.icu/badge?page_id=ironc.notes" onerror="this.style.display=&#39;none&#39;" data-v-1ac272f5><!--]--><!--]--><!--]--><!--]--></a></div></div><div class="content" data-v-915b5228><div class="curtain" data-v-915b5228></div><div class="content-body" data-v-915b5228><!--[--><!--]--><!----><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-915b5228 data-v-168377cf><span id="main-nav-aria-label" class="visually-hidden" data-v-168377cf>Main Navigation</span><!--[--><!--[--><div class="VPFlyout VPNavBarMenuGroup active" data-v-168377cf data-v-16ec77dd><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-16ec77dd><span class="text" data-v-16ec77dd><!----> Free API <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="text-icon" data-v-16ec77dd><path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z"></path></svg></span></button><div class="menu" data-v-16ec77dd><div class="VPMenu" data-v-16ec77dd data-v-26fea522><div class="items" data-v-26fea522><!--[--><!--[--><div class="VPMenuLink" data-v-26fea522 data-v-a6238ea6><a class="VPLink link" href="/free-api/freeapi/kimi/" data-v-a6238ea6 data-v-b7f74d57><!--[-->Kimi<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-26fea522 data-v-a6238ea6><a class="VPLink link" href="/free-api/freeapi/step/" data-v-a6238ea6 data-v-b7f74d57><!--[-->跃问<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-26fea522 data-v-a6238ea6><a class="VPLink link" href="/free-api/freeapi/qwen/" data-v-a6238ea6 data-v-b7f74d57><!--[-->阿里通义<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-26fea522 data-v-a6238ea6><a class="VPLink link" href="/free-api/freeapi/glm/" data-v-a6238ea6 data-v-b7f74d57><!--[-->智谱清言<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-26fea522 data-v-a6238ea6><a class="VPLink link" href="/free-api/freeapi/metaso/" data-v-a6238ea6 data-v-b7f74d57><!--[-->秘塔AI<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-26fea522 data-v-a6238ea6><a class="VPLink link" href="/free-api/freeapi/spark/" data-v-a6238ea6 data-v-b7f74d57><!--[-->讯飞星火<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-26fea522 data-v-a6238ea6><a class="VPLink link" href="/free-api/freeapi/hailuo/" data-v-a6238ea6 data-v-b7f74d57><!--[-->海螺AI<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-26fea522 data-v-a6238ea6><a class="VPLink link" href="/free-api/freeapi/deepseek/" data-v-a6238ea6 data-v-b7f74d57><!--[-->DeepSeek<!--]--><!----></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-26fea522 data-v-a6238ea6><a class="VPLink link active" href="/free-api/freeapi/emohaa/" data-v-a6238ea6 data-v-b7f74d57><!--[-->聆心智能<!--]--><!----></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/free-api/pit/index" tabindex="0" data-v-168377cf data-v-936fc5dc data-v-b7f74d57><!--[-->常见问题<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/free-api/about/index" tabindex="0" data-v-168377cf data-v-936fc5dc data-v-b7f74d57><!--[-->关于<!--]--><!----></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-915b5228 data-v-459395c3><label title="toggle dark mode" data-v-459395c3 data-v-fa58b3ee><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-checked="false" data-v-fa58b3ee data-v-e2ae805e><span class="check" data-v-e2ae805e><span class="icon" data-v-e2ae805e><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-fa58b3ee><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-fa58b3ee><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></label></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-915b5228 data-v-a7544bf0 data-v-18ca0b4c><!--[--><a class="VPSocialLink" href="https://github.com/LLM-Red-Team/free-api" aria-label="github" target="_blank" rel="noopener" data-v-18ca0b4c data-v-f3ebca2e><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-915b5228 data-v-5816c703 data-v-16ec77dd><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-16ec77dd><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-16ec77dd><circle cx="12" cy="12" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="5" cy="12" r="2"></circle></svg></button><div class="menu" data-v-16ec77dd><div class="VPMenu" data-v-16ec77dd data-v-26fea522><!----><!--[--><!--[--><!----><div class="group" data-v-5816c703><div class="item appearance" data-v-5816c703><p class="label" data-v-5816c703>外观</p><div class="appearance-action" data-v-5816c703><label title="toggle dark mode" data-v-5816c703 data-v-fa58b3ee><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-checked="false" data-v-fa58b3ee data-v-e2ae805e><span class="check" data-v-e2ae805e><span class="icon" data-v-e2ae805e><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-fa58b3ee><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-fa58b3ee><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></label></div></div></div><div class="group" data-v-5816c703><div class="item social-links" data-v-5816c703><div class="VPSocialLinks social-links-list" data-v-5816c703 data-v-18ca0b4c><!--[--><a class="VPSocialLink" href="https://github.com/LLM-Red-Team/free-api" aria-label="github" target="_blank" rel="noopener" data-v-18ca0b4c data-v-f3ebca2e><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-915b5228 data-v-768a5a09><span class="container" data-v-768a5a09><span class="top" data-v-768a5a09></span><span class="middle" data-v-768a5a09></span><span class="bottom" data-v-768a5a09></span></span></button></div></div></div></div><!----></header><div class="VPLocalNav" data-v-1a20c99c data-v-45c7eb46><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-45c7eb46><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="menu-icon" data-v-45c7eb46><path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z"></path><path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z"></path><path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z"></path><path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z"></path></svg><span class="menu-text" data-v-45c7eb46>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-45c7eb46 data-v-58983b1e><button class="" data-v-58983b1e>本页目录 <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-58983b1e><path d="M9,19c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l5.3-5.3L8.3,6.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l6,6c0.4,0.4,0.4,1,0,1.4l-6,6C9.5,18.9,9.3,19,9,19z"></path></svg></button><!----></div></div><aside class="VPSidebar" data-v-1a20c99c data-v-dce10d64><div class="curtain" data-v-dce10d64></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-dce10d64><span class="visually-hidden" id="sidebar-aria-label" data-v-dce10d64> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="group" data-v-dce10d64><section class="VPSidebarItem level-0 collapsible has-active" data-v-dce10d64 data-v-3f204acd><div class="item" role="button" tabindex="0" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><h2 class="text" data-v-3f204acd>Free API</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-3f204acd><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="caret-icon" data-v-3f204acd><path d="M9,19c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l5.3-5.3L8.3,6.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l6,6c0.4,0.4,0.4,1,0,1.4l-6,6C9.5,18.9,9.3,19,9,19z"></path></svg></div></div><div class="items" data-v-3f204acd><!--[--><div class="VPSidebarItem level-1 is-link" data-v-3f204acd data-v-3f204acd><div class="item" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><a class="VPLink link link" href="/free-api/freeapi/kimi/" data-v-3f204acd data-v-b7f74d57><!--[--><p class="text" data-v-3f204acd>Kimi</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-3f204acd data-v-3f204acd><div class="item" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><a class="VPLink link link" href="/free-api/freeapi/step/" data-v-3f204acd data-v-b7f74d57><!--[--><p class="text" data-v-3f204acd>跃问</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-3f204acd data-v-3f204acd><div class="item" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><a class="VPLink link link" href="/free-api/freeapi/qwen/" data-v-3f204acd data-v-b7f74d57><!--[--><p class="text" data-v-3f204acd>阿里通义</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-3f204acd data-v-3f204acd><div class="item" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><a class="VPLink link link" href="/free-api/freeapi/glm/" data-v-3f204acd data-v-b7f74d57><!--[--><p class="text" data-v-3f204acd>智谱清言</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-3f204acd data-v-3f204acd><div class="item" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><a class="VPLink link link" href="/free-api/freeapi/metaso/" data-v-3f204acd data-v-b7f74d57><!--[--><p class="text" data-v-3f204acd>秘塔AI</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-3f204acd data-v-3f204acd><div class="item" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><a class="VPLink link link" href="/free-api/freeapi/spark/" data-v-3f204acd data-v-b7f74d57><!--[--><p class="text" data-v-3f204acd>讯飞星火</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-3f204acd data-v-3f204acd><div class="item" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><a class="VPLink link link" href="/free-api/freeapi/hailuo/" data-v-3f204acd data-v-b7f74d57><!--[--><p class="text" data-v-3f204acd>海螺AI</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-3f204acd data-v-3f204acd><div class="item" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><a class="VPLink link link" href="/free-api/freeapi/deepseek/" data-v-3f204acd data-v-b7f74d57><!--[--><p class="text" data-v-3f204acd>DeepSeek</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link is-active has-active" data-v-3f204acd data-v-3f204acd><div class="item" data-v-3f204acd><div class="indicator" data-v-3f204acd></div><a class="VPLink link link" href="/free-api/freeapi/emohaa/" data-v-3f204acd data-v-b7f74d57><!--[--><p class="text" data-v-3f204acd>聆心智能</p><!--]--><!----></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-1a20c99c data-v-f39b2486><div class="VPDoc has-sidebar has-aside" data-v-f39b2486 data-v-bc97124c><div class="container" data-v-bc97124c><div class="aside" data-v-bc97124c><div class="aside-curtain" data-v-bc97124c></div><div class="aside-container" data-v-bc97124c><div class="aside-content" data-v-bc97124c><div class="VPDocAside" data-v-bc97124c data-v-c24c3b46><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" data-v-c24c3b46 data-v-7951c745><div class="content" data-v-7951c745><div class="outline-marker" data-v-7951c745></div><div class="outline-title" data-v-7951c745>本页目录</div><nav aria-labelledby="doc-outline-aria-label" data-v-7951c745><span class="visually-hidden" id="doc-outline-aria-label" data-v-7951c745> Table of Contents for current page </span><ul class="root" data-v-7951c745 data-v-d2de47b4><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-c24c3b46></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--[--><!--[--><!--[--><!--]--><!--]--><!--]--><!--]--></div></div></div></div><div class="content" data-v-bc97124c><div class="content-container" data-v-bc97124c><!--[--><!--]--><div class="VPDocOutlineDropdown" data-v-bc97124c data-v-19d150ea><button class="" data-v-19d150ea>本页目录 <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-19d150ea><path d="M9,19c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l5.3-5.3L8.3,6.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l6,6c0.4,0.4,0.4,1,0,1.4l-6,6C9.5,18.9,9.3,19,9,19z"></path></svg></button><!----></div><main class="main" data-v-bc97124c><div style="position:relative;" class="vp-doc _free-api_freeapi_emohaa_index" data-v-bc97124c><div><h1 id="emohaa-ai-free-服务" tabindex="-1">Emohaa AI Free 服务 <a class="header-anchor" href="#emohaa-ai-free-服务" aria-label="Permalink to &quot;Emohaa AI Free 服务&quot;">​</a></h1><iframe src="https://udify.app/chatbot/LDgsbVTfyTQ000Oq" style="width:100%;height:100%;min-height:700px;" frameborder="0" allow="microphone"></iframe><hr><p><img src="https://img.shields.io/github/stars/llm-red-team/emohaa-free-api.svg" alt=""><img src="https://img.shields.io/github/forks/llm-red-team/emohaa-free-api.svg" alt=""><img src="https://img.shields.io/docker/pulls/vinlic/emohaa-free-api.svg" alt=""></p><p>支持高速流式输出、支持多轮对话，零配置部署，多路 token 支持，自动清理会话痕迹。</p><p>与 ChatGPT 接口完全兼容。</p><h2 id="目录" tabindex="-1">目录 <a class="header-anchor" href="#目录" aria-label="Permalink to &quot;目录&quot;">​</a></h2><ul><li><a href="#免责声明">免责声明</a></li><li><a href="#在线体验">在线体验</a></li><li><a href="#接入准备">接入准备</a><ul><li><a href="#多账号接入">多账号接入</a></li></ul></li><li><a href="#Docker部署">Docker 部署</a><ul><li><a href="#Docker-compose部署">Docker-compose 部署</a></li></ul></li><li><a href="#Render部署">Render 部署</a></li><li><a href="#Vercel部署">Vercel 部署</a></li><li><a href="#原生部署">原生部署</a></li><li><a href="#推荐使用客户端">推荐使用客户端</a></li><li><a href="#接口列表">接口列表</a><ul><li><a href="#对话补全">对话补全</a></li><li><a href="#token存活检测">token 存活检测</a></li></ul></li><li><a href="#注意事项">注意事项</a><ul><li><a href="#Nginx反代优化">Nginx 反代优化</a></li><li><a href="#Token统计">Token 统计</a></li></ul></li></ul><h2 id="免责声明" tabindex="-1">免责声明 <a class="header-anchor" href="#免责声明" aria-label="Permalink to &quot;免责声明&quot;">​</a></h2><p><strong>逆向 API 是不稳定的，建议前往聆心智能官方 <a href="https://www.ai-beings.com/" target="_blank" rel="noreferrer">https://www.ai-beings.com/</a> 付费使用 API，避免封禁的风险。</strong></p><p><strong>本组织和个人不接受任何资金捐助和交易，此项目是纯粹研究交流学习性质！</strong></p><p><strong>仅限自用，禁止对外提供服务或商用，避免对官方造成服务压力，否则风险自担！</strong></p><p><strong>仅限自用，禁止对外提供服务或商用，避免对官方造成服务压力，否则风险自担！</strong></p><p><strong>仅限自用，禁止对外提供服务或商用，避免对官方造成服务压力，否则风险自担！</strong></p><h2 id="在线体验" tabindex="-1">在线体验 <a class="header-anchor" href="#在线体验" aria-label="Permalink to &quot;在线体验&quot;">​</a></h2><p>此链接仅临时测试功能，不可长期使用，长期使用请自行部署。</p><p><a href="https://udify.app/chat/LDgsbVTfyTQ000Oq" target="_blank" rel="noreferrer">https://udify.app/chat/LDgsbVTfyTQ000Oq</a></p><h2 id="接入准备" tabindex="-1">接入准备 <a class="header-anchor" href="#接入准备" aria-label="Permalink to &quot;接入准备&quot;">​</a></h2><p>从 <a href="https://echo.turing-world.com/" target="_blank" rel="noreferrer">echo.turing-world.com</a> 获取 token</p><p>登录进入，由于 emohaa 禁用 F12 开发者工具，请先安装 Manage LocalStorage 插件，再从在当前页面中打开插件并点击 Export 按钮找到 Token 的值，这将作为 Authorization 的 Bearer Token 值：Authorization: Bearer TOKEN</p><h3 id="多账号接入" tabindex="-1">多账号接入 <a class="header-anchor" href="#多账号接入" aria-label="Permalink to &quot;多账号接入&quot;">​</a></h3><p>你可以通过提供多个账号的 token 并使用<code>,</code>拼接提供：</p><p><code>Authorization: Bearer TOKEN1,TOKEN2,TOKEN3</code></p><p>每次请求服务会从中挑选一个。</p><h2 id="docker-部署" tabindex="-1">Docker 部署 <a class="header-anchor" href="#docker-部署" aria-label="Permalink to &quot;Docker 部署&quot;">​</a></h2><p>请准备一台具有公网 IP 的服务器并将 8000 端口开放。</p><p>拉取镜像并启动服务</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">docker</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">run</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-it</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-d</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">--init</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">--name</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">emohaa-free-api</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-p</span><span style="color:#BABED8;"> </span><span style="color:#F78C6C;">8000</span><span style="color:#C3E88D;">:8000</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-e</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">TZ=Asia/Shanghai</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">vinlic/emohaa-free-api:latest</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>查看服务实时日志</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">docker</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">logs</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-f</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">emohaa-free-api</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>重启服务</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">docker</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">restart</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">emohaa-free-api</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>停止服务</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">docker</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">stop</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">emohaa-free-api</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h3 id="docker-compose-部署" tabindex="-1">Docker-compose 部署 <a class="header-anchor" href="#docker-compose-部署" aria-label="Permalink to &quot;Docker-compose 部署&quot;">​</a></h3><div class="language-yaml line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#F07178;">version</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">3</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F07178;">services</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#F07178;">emohaa-free-api</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#F07178;">container_name</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">emohaa-free-api</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#F07178;">image</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">vinlic/emohaa-free-api:latest</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#F07178;">restart</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">always</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#F07178;">ports</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">-</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">8000:8000</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#F07178;">environment</span><span style="color:#89DDFF;">:</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">-</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">TZ=Asia/Shanghai</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><h3 id="render-部署" tabindex="-1">Render 部署 <a class="header-anchor" href="#render-部署" aria-label="Permalink to &quot;Render 部署&quot;">​</a></h3><p><strong>注意：部分部署区域可能无法连接 emohaa，如容器日志出现请求超时或无法连接，请切换其他区域部署！</strong><strong>注意：免费账户的容器实例将在一段时间不活动时自动停止运行，这会导致下次请求时遇到 50 秒或更长的延迟，建议查看<a href="https://github.com/LLM-Red-Team/free-api-hub/#Render%E5%AE%B9%E5%99%A8%E4%BF%9D%E6%B4%BB" target="_blank" rel="noreferrer">Render 容器保活</a></strong></p><ol><li><p>fork 本项目到你的 github 账号下。</p></li><li><p>访问 <a href="https://dashboard.render.com/" target="_blank" rel="noreferrer">Render</a> 并登录你的 github 账号。</p></li><li><p>构建你的 Web Service（New+ -&gt; Build and deploy from a Git repository -&gt; Connect 你 fork 的项目 -&gt; 选择部署区域 -&gt; 选择实例类型为 Free -&gt; Create Web Service）。</p></li><li><p>等待构建完成后，复制分配的域名并拼接 URL 访问即可。</p></li></ol><h3 id="vercel-部署" tabindex="-1">Vercel 部署 <a class="header-anchor" href="#vercel-部署" aria-label="Permalink to &quot;Vercel 部署&quot;">​</a></h3><p><strong>注意：Vercel 免费账户的请求响应超时时间为 10 秒，但接口响应通常较久，可能会遇到 Vercel 返回的 504 超时错误！</strong></p><p>请先确保安装了 Node.js 环境。</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">npm</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">i</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-g</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">vercel</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">--registry</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">http://registry.npmmirror.com</span></span>
<span class="line"><span style="color:#FFCB6B;">vercel</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">login</span></span>
<span class="line"><span style="color:#FFCB6B;">git</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">clone</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">https://github.com/LLM-Red-Team/emohaa-free-api</span></span>
<span class="line"><span style="color:#82AAFF;">cd</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">emohaa-free-api</span></span>
<span class="line"><span style="color:#FFCB6B;">vercel</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">--prod</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h2 id="原生部署" tabindex="-1">原生部署 <a class="header-anchor" href="#原生部署" aria-label="Permalink to &quot;原生部署&quot;">​</a></h2><p>请准备一台具有公网 IP 的服务器并将 8000 端口开放。</p><p>请先安装好 Node.js 环境并且配置好环境变量，确认 node 命令可用。</p><p>安装依赖</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">npm</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">i</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>安装 PM2 进行进程守护</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">npm</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">i</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">-g</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">pm2</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>编译构建，看到 dist 目录就是构建完成</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">npm</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">run</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">build</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>启动服务</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">pm2</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">start</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">dist/index.js</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">--name</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">emohaa-free-api</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>查看服务实时日志</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">pm2</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">logs</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">emohaa-free-api</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>重启服务</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">pm2</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">reload</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">emohaa-free-api</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p>停止服务</p><div class="language-shell line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">pm2</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">stop</span><span style="color:#BABED8;"> </span><span style="color:#C3E88D;">emohaa-free-api</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><h2 id="推荐使用客户端" tabindex="-1">推荐使用客户端 <a class="header-anchor" href="#推荐使用客户端" aria-label="Permalink to &quot;推荐使用客户端&quot;">​</a></h2><p>使用以下二次开发客户端接入 free-api 系列项目更快更简单，支持文档/图像上传！</p><p>由 <a href="https://github.com/Yanyutin753/lobe-chat" target="_blank" rel="noreferrer">Clivia</a> 二次开发的 LobeChat <a href="https://github.com/Yanyutin753/lobe-chat" target="_blank" rel="noreferrer">https://github.com/Yanyutin753/lobe-chat</a></p><p>由 <a href="https://github.com/SuYxh" target="_blank" rel="noreferrer">时光@</a> 二次开发的 ChatGPT Web <a href="https://github.com/SuYxh/chatgpt-web-sea" target="_blank" rel="noreferrer">https://github.com/SuYxh/chatgpt-web-sea</a></p><h2 id="接口列表" tabindex="-1">接口列表 <a class="header-anchor" href="#接口列表" aria-label="Permalink to &quot;接口列表&quot;">​</a></h2><p>目前支持与 openai 兼容的 <code>/v1/chat/completions</code> 接口，可自行使用与 openai 或其他兼容的客户端接入接口，或者使用 <a href="https://dify.ai/" target="_blank" rel="noreferrer">dify</a> 等线上服务接入使用。</p><h3 id="对话补全" tabindex="-1">对话补全 <a class="header-anchor" href="#对话补全" aria-label="Permalink to &quot;对话补全&quot;">​</a></h3><p>对话补全接口，与 openai 的 <a href="https://platform.openai.com/docs/guides/text-generation/chat-completions-api" target="_blank" rel="noreferrer">chat-completions-api</a> 兼容。</p><p><strong>POST /v1/chat/completions</strong></p><p>header 需要设置 Authorization 头部：</p><div class="language- line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#babed8;">Authorization: Bearer [refresh_token]</span></span>
<span class="line"><span style="color:#babed8;"></span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>请求数据：</p><div class="language-json line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">messages</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">[</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">role</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">user</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">content</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">你好</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#89DDFF;">}</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">],</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#676E95;font-style:italic;">// 如果使用SSE流请设置为true，默认false</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">stream</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">false</span></span>
<span class="line"><span style="color:#89DDFF;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><p>响应数据：</p><div class="language-json line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">id</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">f73f02e6-6b43-4a46-ac24-3a9ea8d15145</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">model</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">emohaa</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">object</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">chat.completion</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">choices</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">[</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">index</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">message</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#89DDFF;">&quot;</span><span style="color:#F78C6C;">role</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">assistant</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">,</span></span>
<span class="line"><span style="color:#BABED8;">        </span><span style="color:#89DDFF;">&quot;</span><span style="color:#F78C6C;">content</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;"> 你好啊！我是Emohaa，想和我聊点什么吗？ 今天心情如何？</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">},</span></span>
<span class="line"><span style="color:#BABED8;">      </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">finish_reason</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">stop</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#89DDFF;">}</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">],</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">usage</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">prompt_tokens</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#F78C6C;">1</span><span style="color:#89DDFF;">,</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">completion_tokens</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#F78C6C;">1</span><span style="color:#89DDFF;">,</span></span>
<span class="line"><span style="color:#BABED8;">    </span><span style="color:#89DDFF;">&quot;</span><span style="color:#FFCB6B;">total_tokens</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#F78C6C;">2</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">},</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">created</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#F78C6C;">1710603111</span></span>
<span class="line"><span style="color:#89DDFF;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br></div></div><h3 id="token-存活检测" tabindex="-1">token 存活检测 <a class="header-anchor" href="#token-存活检测" aria-label="Permalink to &quot;token 存活检测&quot;">​</a></h3><p>检测 token 是否存活，如果存活 live 未 true，否则为 false，请不要频繁（小于 10 分钟）调用此接口。</p><p><strong>POST /token/check</strong></p><p>请求数据：</p><div class="language-json line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">token</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#89DDFF;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><p>响应数据：</p><div class="language-json line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">{</span></span>
<span class="line"><span style="color:#BABED8;">  </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C792EA;">live</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">:</span><span style="color:#BABED8;"> </span><span style="color:#89DDFF;">true</span></span>
<span class="line"><span style="color:#89DDFF;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h2 id="注意事项" tabindex="-1">注意事项 <a class="header-anchor" href="#注意事项" aria-label="Permalink to &quot;注意事项&quot;">​</a></h2><h3 id="nginx-反代优化" tabindex="-1">Nginx 反代优化 <a class="header-anchor" href="#nginx-反代优化" aria-label="Permalink to &quot;Nginx 反代优化&quot;">​</a></h3><p>如果您正在使用 Nginx 反向代理 kimi-free-api，请添加以下配置项优化流的输出效果，优化体验感。</p><div class="language-nginx line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">nginx</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;"># 关闭代理缓冲。当设置为off时，Nginx会立即将客户端请求发送到后端服务器，并立即将从后端服务器接收到的响应发送回客户端。</span></span>
<span class="line"><span style="color:#89DDFF;">proxy_buffering </span><span style="color:#BABED8;">off</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 启用分块传输编码。分块传输编码允许服务器为动态生成的内容分块发送数据，而不需要预先知道内容的大小。</span></span>
<span class="line"><span style="color:#89DDFF;">chunked_transfer_encoding </span><span style="color:#BABED8;">on</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 开启TCP_NOPUSH，这告诉Nginx在数据包发送到客户端之前，尽可能地发送数据。这通常在sendfile使用时配合使用，可以提高网络效率。</span></span>
<span class="line"><span style="color:#89DDFF;">tcp_nopush </span><span style="color:#BABED8;">on</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 开启TCP_NODELAY，这告诉Nginx不延迟发送数据，立即发送小数据包。在某些情况下，这可以减少网络的延迟。</span></span>
<span class="line"><span style="color:#89DDFF;">tcp_nodelay </span><span style="color:#BABED8;">on</span><span style="color:#89DDFF;">;</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 设置保持连接的超时时间，这里设置为120秒。如果在这段时间内，客户端和服务器之间没有进一步的通信，连接将被关闭。</span></span>
<span class="line"><span style="color:#89DDFF;">keepalive_timeout </span><span style="color:#BABED8;">120</span><span style="color:#89DDFF;">;</span></span>
<span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><h3 id="token-统计" tabindex="-1">Token 统计 <a class="header-anchor" href="#token-统计" aria-label="Permalink to &quot;Token 统计&quot;">​</a></h3><p>由于推理侧不再 kimi-free-api，因此 token 不可统计，将以固定数字返回。</p></div></div></main><footer class="VPDocFooter" data-v-bc97124c data-v-37df6145><!--[--><!--]--><div class="edit-info" data-v-37df6145><!----><div class="last-updated" data-v-37df6145><p class="VPLastUpdated" data-v-37df6145 data-v-9c29f171>上次更新: <time datetime="2024-05-11T02:17:18.000Z" data-v-9c29f171></time></p></div></div><div class="prev-next" data-v-37df6145><div class="pager" data-v-37df6145><a class="pager-link prev" href="/free-api/freeapi/deepseek/" data-v-37df6145><span class="desc" data-v-37df6145>上一篇</span><span class="title" data-v-37df6145>DeepSeek</span></a></div><div class="has-prev pager" data-v-37df6145><!----></div></div></footer><!--[--><!--[--><!--[--><div class="copyright" data-v-3845651f><img class="visitor" src="https://visitor-badge.laobi.icu/badge?page_id=ironc.notes./free-api/freeapi/emohaa/index" title="当前页面累计访问数" onerror="this.style.display=&#39;none&#39;" data-v-3845651f> Copyright © 2024 </div><!--]--><!--]--><!--]--></div></div></div></div></div><footer class="VPFooter has-sidebar" data-v-1a20c99c data-v-8ede0c93><div class="container" data-v-8ede0c93><p class="message" data-v-8ede0c93>你相信光吗</p><p class="copyright" data-v-8ede0c93>Copyright © 2024</p></div></footer><!--[--><!--]--></div></div>
    <script>__VP_HASH_MAP__ = JSON.parse("{\"about_index.md\":\"8ae65b1b\",\"freeapi_index.md\":\"67b63f40\",\"freeapi_emohaa_index.md\":\"3aeabad8\",\"pit_glm.md\":\"d7020a1c\",\"pit_emohaa.md\":\"0c95c33a\",\"freeapi_metaso_index.md\":\"8a7f56b6\",\"freeapi_glm_index.md\":\"862571da\",\"index.md\":\"efc31dab\",\"pit_index.md\":\"c5f5685f\",\"freeapi_hailuo_index.md\":\"4916c7f9\",\"freeapi_spark_index.md\":\"bfb3a927\",\"freeapi_deepseek_index.md\":\"c21756be\",\"pit_metaso.md\":\"c3855477\",\"pit_qwen.md\":\"67c321bb\",\"pit_spark.md\":\"231ba209\",\"pit_step.md\":\"2d917a2a\",\"pit_kimi.md\":\"3a2889d6\",\"freeapi_kimi_index.md\":\"da7b88e6\",\"freeapi_step_index.md\":\"7df86298\",\"freeapi_qwen_index.md\":\"8320c9d4\"}")
__VP_SITE_DATA__ = JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"Free API\",\"description\":\"支持高速流式输出、联网搜索、长文档解读、图像解析、多轮对话，零配置部署，多路token支持，自动清理会话痕迹\",\"base\":\"/free-api/\",\"head\":[],\"appearance\":true,\"themeConfig\":{\"i18nRouting\":false,\"logo\":\"/logo.png\",\"nav\":[{\"text\":\"Free API\",\"items\":[{\"text\":\"Kimi\",\"link\":\"/freeapi/kimi/\"},{\"text\":\"跃问\",\"link\":\"/freeapi/step/\"},{\"text\":\"阿里通义\",\"link\":\"/freeapi/qwen/\"},{\"text\":\"智谱清言\",\"link\":\"/freeapi/glm/\"},{\"text\":\"秘塔AI\",\"link\":\"/freeapi/metaso/\"},{\"text\":\"讯飞星火\",\"link\":\"/freeapi/spark/\"},{\"text\":\"海螺AI\",\"link\":\"/freeapi/hailuo/\"},{\"text\":\"DeepSeek\",\"link\":\"/freeapi/deepseek/\"},{\"text\":\"聆心智能\",\"link\":\"/freeapi/emohaa/\"}],\"activeMatch\":\"^/freeapi\"},{\"text\":\"常见问题\",\"link\":\"/pit/index\",\"activeMatch\":\"^/pit\"},{\"text\":\"关于\",\"link\":\"/about/index\"}],\"sidebar\":{\"/freeapi\":[{\"text\":\"Free API\",\"collapsed\":false,\"items\":[{\"text\":\"Kimi\",\"link\":\"/freeapi/kimi/\"},{\"text\":\"跃问\",\"link\":\"/freeapi/step/\"},{\"text\":\"阿里通义\",\"link\":\"/freeapi/qwen/\"},{\"text\":\"智谱清言\",\"link\":\"/freeapi/glm/\"},{\"text\":\"秘塔AI\",\"link\":\"/freeapi/metaso/\"},{\"text\":\"讯飞星火\",\"link\":\"/freeapi/spark/\"},{\"text\":\"海螺AI\",\"link\":\"/freeapi/hailuo/\"},{\"text\":\"DeepSeek\",\"link\":\"/freeapi/deepseek/\"},{\"text\":\"聆心智能\",\"link\":\"/freeapi/emohaa/\"}]}],\"/pit/\":[{\"text\":\"常见问题\",\"items\":[{\"text\":\"Kimi\",\"link\":\"/pit/kimi\"},{\"text\":\"跃问\",\"link\":\"/pit/step\"},{\"text\":\"阿里通义\",\"link\":\"/pit/qwen\"},{\"text\":\"智谱清言\",\"link\":\"/pit/glm\"},{\"text\":\"秘塔AI\",\"link\":\"/pit/metaso\"},{\"text\":\"讯飞星火\",\"link\":\"/pit/spark\"},{\"text\":\"海螺AI\",\"link\":\"/pit/hailuo\"},{\"text\":\"DeepSeek\",\"link\":\"/pit/deepseek/\"},{\"text\":\"聆心智能\",\"link\":\"/pit/emohaa\"}]}]},\"outline\":{\"level\":\"deep\",\"label\":\"本页目录\"},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/LLM-Red-Team/free-api\"}],\"footer\":{\"message\":\"你相信光吗\",\"copyright\":\"Copyright © 2024\"},\"darkModeSwitchLabel\":\"外观\",\"returnToTopLabel\":\"返回顶部\",\"lastUpdatedText\":\"上次更新\",\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"}},\"locales\":{},\"scrollOffset\":90,\"cleanUrls\":true}")</script>
    
  </body>
</html>